#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_INIT(mp710, 0.1, koldun@id.ru)
AC_CANONICAL_SYSTEM
AC_PREREQ([2.63])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/mp710.c])
AC_CONFIG_HEADERS([src/config.h])
AC_PREFIX_DEFAULT(/usr/local/mp710)

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL

# Checks for libraries.
AC_CHECK_LIB([pthread], [pthread_create], , AC_MSG_ERROR([pthreads required]))

PKG_PROG_PKG_CONFIG

if test -z "${PKG_CONFIG}"; then
    AC_MSG_ERROR(["pkg-config not found"])
fi

PKG_CHECK_MODULES([libusb1], libusb-1.0, , AC_MSG_ERROR([libusb-1.0 required]))

CFLAGS="$CFLAGS $libusb1_CFLAGS"

# Checks for header files.
AC_HEADER_STDC
AC_HEADER_STDBOOL
#AC_CHECK_HEADERS([stdlib.h string.h])

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset])

AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
